home *** CD-ROM | disk | FTP | other *** search
/ Aminet 7 / Aminet 7 - August 1995.iso / Aminet / docs / misc / ConcNews.lha / news / amiga.programming / comp.sys.amiga.programmer_27820_000015.msg < prev    next >
Encoding:
Internet Message Format  |  1994-11-27  |  1.7 KB

  1. Path: etek.chalmers.se!chalmers.se!sunic!uunet!caen!uvaarpa!adastra!mbs
  2. From: mbs@adastra.cvl.va.us (Michael B. Smith)
  3. Newsgroups: comp.sys.amiga.programmer
  4. Subject: Re: Stopping dos VOLUME requesters
  5. Message-ID: <mbs.1sml@adastra.cvl.va.us>
  6. Date: 18 Mar 93 11:50:01 GMT
  7. References: <1993Mar17.165913.64930@qut.edu.au>
  8. Organization: Well, I haven't decided on a name yet...
  9. Lines: 41
  10. X-NewsSoftware: GRn-beta 1.16g (16.3.93) by Michael B. Smith & Mike Schwartz
  11. MIME-Version: 1.0
  12. Content-Type: text/plain; charset=iso-8859-1
  13. Content-Transfer-Encoding: 8bit
  14.  
  15. In article <1993Mar17.165913.64930@qut.edu.au> podesta@qut.edu.au writes:
  16. > Greetings.
  17.  
  18. Salutations.
  19.  
  20. > When loading a file through the DOS library, the system will pop up an
  21. > "Insert disk PORK in any drive" requester.
  22. >
  23. > Is there a way to attempt to open a file using a volume name and have it
  24. > instantly fail if the disk is not present, rather than have the system open
  25. > a requester? Some flag in some structure, perhaps?
  26.  
  27.         struct Process
  28.                 *me = (struct Process *) FindTask (NULL);
  29.         APTR
  30.                 my_winptr = me->pr_WindowPtr;
  31.         BPTR
  32.                 fh;
  33.         int
  34.                 err;
  35.  
  36.         me->pr_WindowPtr = -1;
  37.         fh = Open ("PORK:filename", MODE_OLDFILE);
  38.         me->pr_WindowPtr = my_winptr;
  39.  
  40.         if (!fh) {
  41.                 err = IoErr ();
  42.                 /* Likely errors:
  43.                 **
  44.                 **      ERROR_DEVICE_NOT_MOUNTED
  45.                 **      ERROR_DIR_NOT_FOUND
  46.                 **      ERROR_OBJECT_NOT_FOUND
  47.                 */
  48.         }
  49.  
  50. > Thanks in advance.
  51.  
  52. De nada.
  53. --
  54.   //   Michael B. Smith
  55. \X/    mbs@adastra.cvl.va.us  -or-  uunet.uu.net!virginia.edu!adastra!mbs